//
//  DetailViewController.swift
//  NavigationComb-ib
//
//  Created by BZF on 2020/8/19.
//  Copyright © 2020 bzf. All rights reserved.
//

import UIKit
import WebKit

class DetailViewController: UIViewController,WKNavigationDelegate {

    var mUrl: String!
    
    override func viewDidLoad() {
        super.viewDidLoad()

        let webView = WKWebView(frame: self.view.frame)
        self.view.addSubview(webView)
        webView.navigationDelegate = self
        
        let requestUrl = URL(string: mUrl)
        let request = URLRequest(url: requestUrl!)
        webView.load(request)
    }
    

    func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
           print("网页开始加载")
       }


       func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) {
           print("内容开始返回")
       }
       
       func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
           print("加载失败：",error.localizedDescription)
       }
       
       func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
           print("加载完成")
       }

}
